from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, String,Date,CHAR
from config.database import Base


class EmployeeInfo(Base):
    """
    员工表
    希望将 employee_info 表对应的 SQLAlchemy 模型类，按照与 SysDept 类相同的格式进行编写
    """
    __tablename__ = 'employee_info'

    id = Column(Integer, primary_key=True, autoincrement=True, comment='员工ID')
    name = Column(String(50), nullable=False, comment='员工姓名')
    id_card = Column(String(20), nullable=True, default=None, comment='身份证信息')
    phone = Column(String(12), nullable=True, default=None, comment='手机号（调整为12位）')
    bank_card = Column(String(30), nullable=True, default=None, comment='银行卡号')
    hire_date = Column(Date, nullable=True, default=None, comment='入职时间')
    resignation_date = Column(Date, nullable=True, default=None, comment='离职时间')
    status = Column(CHAR(1), nullable=True, default='0', comment='员工状态（0在职 1离职 2停用）')
    del_flag = Column(CHAR(1), nullable=True, default='0', comment='删除标志（0代表存在 2代表删除）')
    create_by = Column(String(64), nullable=True, default='', comment='创建者')
    create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
    update_by = Column(String(64), nullable=True, default='', comment='更新者')
    update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
